package com.mars.boss.manager.exception;

import com.mars.common.exception.BizException;

public class MenuBizException extends BizException {

	private static final long serialVersionUID = 1L;
	
	/**
	 * 未知异常
	 */
	public static final int BANK_UNKNOWN_ERROR = 10020000;
	/**
	 * 参数错误
	 */
	public static final int BANK_SERVICE_PARAMS_ERROR = 10020001;

	/**
	 * 父节点不能关联自己
	 */
	public static final MenuBizException NOT_RELATED_SELF = new MenuBizException(10020114, " 父节点不能关联自己");
	
	/**
	 * 菜单名称不能为空
	 */
	public static final MenuBizException MENU_NAME_NOT_NULL = new MenuBizException(10020114, " 菜单名称不能为空");

	public MenuBizException() {
	}

	public MenuBizException(int code, String msg) {
		super(code, msg);
	}
	
	public MenuBizException(String msgFormat, Object... args) {
		super(msgFormat, args);
	}
	
	public MenuBizException(int code, String msgFormat, Object... args) {
		super(code, msgFormat, args);
	}
	
	
	public MenuBizException newInstance(String msgFormat, Object... args) {
		return new MenuBizException(this.code, msgFormat, args);
	}
	
	public MenuBizException logInfo() {
		logger.info("==>MenuBizException, code:" + this.code + ", msg:" + this.msg);
		return new MenuBizException(this.code, this.msg);
	}
	

}
